package traveldream.ejb.DTO;

import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;

import org.hibernate.validator.constraints.NotEmpty;

public class PackageDTO {

	private int id;
	
	@NotEmpty(message = "You must specify a Name")
	private String name;
	
	@NotEmpty(message = "You must specify a Description")
	private String description;
	
	@Pattern(regexp = "(^[a-zA-Z]+$)",
            message = "You must specify a Nation")
	private String Nation;
	
	@Min(value = 1)
	private int price;
	
	@NotNull(message = "You must specify an hotel")
	private int idHotel;
	@NotNull(message = "You must specify a transportation mean for the going trip")
	private int idGoing;
	@NotNull(message = "You must specify a trasportation mean for the return")
	private int idReturn;
	@NotNull(message = "You must specify an excursion")
	private int idExcursion;
	
	private boolean invalid;
	
	
	public int getId() {
		return id;
	}
	public void setId(int id) {
		this.id = id;
	}
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public String getDescription() {
		return description;
	}
	public void setDescription(String description) {
		this.description = description;
	}
	public String getNation() {
		return Nation;
	}
	public void setNation(String nation) {
		Nation = nation;
	}
	public int getPrice() {
		return price;
	}
	public void setPrice(int price) {
		this.price = price;
	}
	public int getIdHotel() {
		return idHotel;
	}
	public void setIdHotel(int idHotel) {
		this.idHotel = idHotel;
	}
	public int getIdGoing() {
		return idGoing;
	}
	public void setIdGoing(int idGoing) {
		this.idGoing = idGoing;
	}
	public int getIdReturn() {
		return idReturn;
	}
	public void setIdReturn(int idReturn) {
		this.idReturn = idReturn;
	}
	public int getIdExcursion() {
		return idExcursion;
	}
	public void setIdExcursion(int idExcursion) {
		this.idExcursion = idExcursion;
	}
	
	public boolean equals(PackageDTO pDTO){
		return pDTO.description.equals(description) && pDTO.idExcursion == idExcursion && pDTO.idGoing == idGoing 
				&& pDTO.idHotel == idHotel && pDTO.idReturn == idReturn && pDTO.name.equals(name) && pDTO.Nation.equals(Nation)
				&& pDTO.price == price;
	}
	public boolean isInvalid() {
		return invalid;
	}
	public void setInvalid(boolean invalid) {
		this.invalid = invalid;
	}
	
	
}
